package com.atguigu.scala.chapter9

import scala.util.Try


/**
 * @author lizikuan
 * @date 2021/5/25 19:05
 */
object $01_Exception {
  def main(args: Array[String]): Unit = {
    println(m1(10, 2))
    def m1(a: Int, b: Int) = {
      //      if(b==0)
      //        throw new Exception("除数不能为0")
      val i = Try({
        a/b
      }).getOrElse(90)
      i
    }
  }
}
